//
// Created on 2025/11/15.
// Author 秦光磊.

#ifndef MYAPPLICATION_PLUGIN_RENDER_H
#define MYAPPLICATION_PLUGIN_RENDER_H
#include "render/egl_core.h"
#include <cstdint>
#include <native_window/external_window.h>
namespace MyApp {
class PluginRender {
public:
    PluginRender() {}
    explicit PluginRender(int64_t &id);
    ~PluginRender() {
        if (eglCore_ != nullptr) {
            eglCore_->Release();
            delete eglCore_;
            eglCore_ = nullptr;
        }
    }
    void ChangeColor();
    void DrawPattern();
    int32_t HadDraw();
    int32_t HasChangedColor();
    void InitNativeWindow(OHNativeWindow *window);
    void UpdateNativeWindowSize(int width, int height);

private:
    EGLCore *eglCore_;
    int64_t id_;
    int32_t hasDraw_;
    int32_t hasChangeColor_;
};
} // namespace MyApp
#endif // MYAPPLICATION_PLUGIN_RENDER_H
